package com.ynny.chapter04;

import jakarta.servlet.ServletException;
import jakarta.servlet.annotation.WebServlet;
import jakarta.servlet.http.HttpServlet;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;

import java.io.IOException;

@WebServlet("/demo03")
public class Demo03Servlet extends HttpServlet {


    @Override
    protected void service(HttpServletRequest request,
                           HttpServletResponse response) throws ServletException, IOException {

        System.out.println("I hava a KFC");

        System.out.println("no 前往了 demo04");
        //通过客户端重定向的方式
        response.sendRedirect("/chapter03/demo04");

    }
}
